package com.dingtalk.demo.web.controller;

import com.dingtalk.demo.biz.BlogBiz;
import com.dingtalk.demo.biz.common.BizResult;
import com.dingtalk.demo.biz.query.BlogQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by well on 17/7/17.
 */
@Controller
public class BlogController {

    @Autowired
    private BlogBiz blogBiz;

    @RequestMapping("blog/index")
    public String index(HttpServletRequest request, ModelMap modelMap){
        BlogQuery blogQuery = new BlogQuery();
        BizResult list = blogBiz.list(blogQuery);
        modelMap.putAll(list.data);
        return "blog/index.vm";
    }
}
